package com.idc.quotation.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.idc.common.constant.RedisKey;
import com.idc.quotation.entity.SystemUser;
import com.idc.quotation.mapper.SystemUserMapper;
import com.idc.quotation.service.SystemUserService;

@Service
public class SystemUserServiceImpl implements SystemUserService, RedisKey {

	@Autowired
	private SystemUserMapper systemUserMapper;

	@Override
	public void add(SystemUser systemUser) {
		systemUserMapper.insert(systemUser);
	}

	@Override
	public void delete(Long id) {
		systemUserMapper.deleteById(id);
	}

	@Override
	public SystemUser findById(Long id) {
		return systemUserMapper.selectById(id);
	}

	@Override
	public void update(SystemUser systemUser) {
		systemUserMapper.updateById(systemUser);
	}

	@Override
	public Long maxId() {
		return systemUserMapper.maxId();
	}

	@Override
	public List<Map<String, Object>> count() {
		return systemUserMapper.countData();
	}

}
